# -*- coding: utf-8 -*-
import threading
import time
__author__ = 'hftec'
import lcopa_scan
class RandomScanThread(threading.Thread): #The timer class is derived from the class threading.Thread
    def __init__(self):
        threading.Thread.__init__(self)
        self.lcopa_scan =lcopa_scan.LcopaScan('./u-phi/DF2015-FA02.txt')
        self.thread_stop = False

    def run(self): #Overwrite run() method, put what you want the thread do here
        try:
            while not self.thread_stop:
                self.lcopa_scan.ramdom_scan(0.02,-0.02)
                time.sleep(1)
        except KeyboardInterrupt,e:
            print "ctrl c\r\n"

    def stop(self):
        self.thread_stop = True